<?php
namespace Admin\Controller;
class DashboardController extends AdminController{ 
    
    public function index(){
        $total = M('Manager')->count();
        $Page = new \Think\Page($total, 20);
        $result = M('Manager')->page($Page->nowPage, $Page->listRows)->order('id DESC')->select();
        foreach ($result as $key => $val) {
            $result[$key]['group_name'] = M('ManagerGroup')->where(['id' => $val['group']])->getField('name');
        }
        $this->assign('page', $Page->show());
        $this->assign('result', $result);
        $this->display();
    }
}

